home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 30 / Amiga Format AFCD30 (Sep 1998, Issue 114).iso / -seriously_amiga- / sound / player6.1a / source / 610.4.asm next >
Assembly Source File  |  1998-06-22  |  43KB  |  2,767 lines

  1. * The Player 6.1A - A4000 fixed by NoName/Haujobb^Sector 7
  2. *                   Some Enforcer Hits fixed by Platon42
  3. *
  4. * for Devpac 3, ASM-One, PhxAss and maybe some other assemblers
  5. *
  6. * NEEDS: Default sizes must be words (ASM-One default...)
  7. *        Preferably no optimizations on (the jump table must be word jumps)
  8. *
  9. * Tested with Devpac 3.04 by Guru
  10. * Tested with PhxAss 4.14, Asm-Pro 1.1 and ASM-One 1.29 
  11. *
  12. * Note1: If you have already tailored the 610.2 version to your needs
  13. *        and don't want to do this work again, just apply the
  14. *        changes that are marked with ";!!!" to your source!
  15. *
  16. * Note2: INTREQ ($dff09c) must ALWAYS be written twice on A4040,A4060.
  17.         
  18. example = 1    ;0 = assemble the pure replay
  19.         ;1 = assemble as an example, "P61.testmod" should be played
  20.  
  21. ;makebin    ;uncomment this and a new binary will be
  22.         ;AUTO-saved to "ram:610.4.bin_new" (ASM-One only)
  23.  
  24. asmone = 0    ;0 = Devpac, PhxAss and the like
  25.         ;1 = ASM-One (prints out some infos while assembling)
  26.  
  27.  
  28. ;start = 6    ;Starting position
  29.  
  30. fade  = 1    ;0 = Normal, NO master volume control possible
  31.         ;1 = Use master volume (P61_Master)
  32.  
  33. jump = 1    ;0 = do NOT include position jump code (P61_SetPosition)
  34.         ;1 = Include
  35.  
  36. system = 1    ;0 = killer
  37.         ;1 = friendly
  38.  
  39. CIA = 1        ;0 = CIA disabled
  40.         ;1 = CIA enabled
  41.  
  42. exec = 1    ;0 = ExecBase destroyed
  43.         ;1 = ExecBase valid
  44.  
  45. lev6 = 1    ;0 = NonLev6
  46.         ;1 = Lev6 used
  47.  
  48. opt020 = 0    ;0 = MC680x0 code
  49.         ;1 = MC68020+ or better
  50.  
  51. channels = 4    ;amount of channels to be played
  52.  
  53. use = -1    ;The Usecode
  54.  
  55.     incdir    include/
  56.     include Player61.i
  57.         ifne    asmone
  58.         include infos.s
  59.         endc
  60.  
  61.     ifne    example
  62.     section    Player6.1A,code
  63.  
  64.     movem.l    d0-a6,-(sp)
  65.     lea    $dff000,a6
  66.     ifeq    system
  67.     move    $1c(a6),-(sp)
  68.     move    #$7fff,$9a(a6)
  69.     move    2(a6),-(sp)
  70.     move    #$7ff,$96(a6)
  71.     endc
  72.  
  73.     lea    P61_data,a0    ;Module
  74.     sub.l    a1,a1        ;No separate samples
  75. ;    lea    P61_smp,a1    ;Samples
  76.  
  77.     sub.l    a2,a2        ;No packed samples
  78. ;       lea     samples,a2      ;Sample buffer in chip,only for packed samples
  79.     moveq    #0,d0        ;Auto Detect
  80.     bsr    P61_motuuli+P61_InitOffset
  81.  
  82.     tst    d0        ;Went ok?
  83.     bne    P61_exit
  84.  
  85. P61_sync
  86.     ifeq    CIA
  87.     move.l    4(a6),d0
  88.     andi.l    #$1ff00,d0
  89.     cmp.l    #$8100,d0
  90.     bne.b    P61_sync
  91.  
  92. P61_sync2
  93.     move.l    4(a6),d0
  94.     andi.l    #$1ff00,d0
  95.     cmp.l    #$8200,d0
  96.     bne.b    P61_sync2
  97.  
  98.     ifne    example
  99.     ifnd    makebin
  100.     move    #$fff,$180(a6)
  101.     endc
  102.     endc
  103.     bsr    P61_motuuli+P61_MusicOffset
  104.     ifne    example
  105.     ifnd    makebin
  106.     clr    $180(a6)
  107.     endc
  108.     endc
  109.  
  110.     moveq    #0,d0
  111.     move    6(a6),d0
  112.     sub.l    #$8200,d0
  113.     cmp.l    P61_raster(pc),d0
  114.     ble.b    P61_kosj
  115.     move    d0,P61_raster+2
  116. P61_kosj
  117.     tst    P61_raster2+2
  118.     bne.b    P61_doing
  119.     move    d0,P61_raster2+2
  120.     bra    P61_doneg
  121. P61_doing
  122.     add.l    P61_raster2(pc),d0
  123.     asr.l    #1,d0
  124.     move.l    d0,P61_raster2
  125. P61_doneg
  126.     addq.l    #1,P61_frames
  127.  
  128.     ifne    fade
  129.     btst    #2,$16(a6)
  130.     bne.b    P61_jid
  131.     move    P61_diri(pc),d0
  132.     sub    d0,P61_motuuli+P61_MasterVolume
  133.     bne.b    P61_judo
  134.     neg    P61_diri
  135.     bra.b    P61_jid
  136. P61_judo
  137.     cmp    #64,P61_motuuli+P61_MasterVolume
  138.     bne.b    P61_jid
  139.     neg    P61_diri
  140.     endc
  141.  
  142. P61_jid
  143.     endc
  144.  
  145.     btst    #6,$bfe001
  146.     bne    P61_sync
  147.  
  148. P61_exit
  149.     bsr    P61_motuuli+P61_EndOffset
  150.  
  151.     ifeq    system
  152.     move    (sp)+,d7
  153.     bset    #15,d7
  154.     move    #$7ff,$96(a6)
  155.     move    d7,$96(a6)
  156.  
  157.     move    (sp)+,d7
  158.     bset    #15,d7
  159.     move    #$7fff,$9a(a6)
  160.     move    d7,$9a(a6)
  161.     endc
  162.     movem.l    (sp)+,d0-a6
  163.  
  164.     move.l    P61_raster(pc),d0
  165.     move.l    P61_raster2(pc),d1
  166.     move.l    P61_frames(pc),d2
  167.     move.l    P61_positionbase(pc),a0
  168.     move.l    P61_patternbase(pc),a1
  169.     move.l    P61_spos(pc),a2
  170.     rts
  171.  
  172. P61_IRQsave
  173.         dc    0
  174. P61_DMAsave
  175.         dc    0
  176. P61_raster
  177.         dc.l    0
  178. P61_raster2
  179.         dc.l    0
  180. P61_frames
  181.         dc.l    0
  182. P61_diri
  183.         dc    1
  184.     endc
  185. ********************************
  186. *        Player 6.1A ®         *
  187. *      All in one-version      *
  188. *        Version 610.4         *
  189. *   © 1992-95 Jarno Paananen   *
  190. *     All rights reserved      *
  191. * Fixed by NoName and Platon42 *
  192. ********************************
  193.  
  194.  
  195. ******** START OF BINARY FILE **************
  196.  
  197. P61_motuuli
  198.     bra.w    P61_Init
  199.     ifeq    CIA
  200.     bra.w    P61_Music
  201.     else
  202.     rts
  203.     rts
  204.     endc
  205.     bra.w    P61_End
  206.     rts                ;no P61_SetRepeat
  207.     rts
  208.     ifne    jump
  209.     bra.w    P61_SetPosition
  210.     else
  211.     rts
  212.     rts
  213.     endc
  214.  
  215. P61_Master
  216.         dc    64        ;Master volume (0-64)
  217. P61_Tempo
  218.         dc    1        ;Use tempo? 0=no,non-zero=yes
  219. P61_Play
  220.         dc    1        ;Stop flag (0=stop)
  221. P61_E8
  222.         dc    0        ;Info nybble after command E8
  223. P61_VBR
  224.         dc.l    0        ;If you're using non-valid execbase
  225.                     ;put VBR here! (Otherwise 0 assumed)
  226.                     ;You can also get VBR from here, if
  227.                     ;using exec-valid version
  228.  
  229. P61_Pos
  230.         dc    0        ;Current song position
  231. P61_Patt
  232.         dc    0        ;Current pattern
  233. P61_CRow
  234.         dc    0        ;Current pattern row
  235.  
  236. P61_Temp0Offset
  237.     dc.l    P61_temp0-P61_motuuli
  238. P61_Temp1Offset
  239.     dc.l    P61_temp1-P61_motuuli
  240. P61_Temp2Offset
  241.     dc.l    P61_temp2-P61_motuuli
  242. P61_Temp3Offset
  243.     dc.l    P61_temp3-P61_motuuli
  244.  
  245. P61_getnote    macro
  246.     moveq    #$7e,d0
  247.     and.b    (a5),d0
  248.     beq.b    .nonote
  249.     ifne    P61_vib
  250.     clr.b    P61_VibPos(a5)
  251.     endc
  252.     ifne    P61_tre
  253.     clr.b    P61_TrePos(a5)
  254.     endc
  255.  
  256.     ifne    P61_ft
  257.     add    P61_Fine(a5),d0
  258.     endc
  259.     move    d0,P61_Note(a5)
  260.     move    (a2,d0),P61_Period(a5)
  261.  
  262. .nonote
  263.     endm
  264.  
  265.     ifeq    system
  266.     ifne    CIA
  267. P61_intti
  268.     movem.l    d0-a6,-(sp)
  269.     tst.b    $bfdd00
  270.     lea    $dff000,a6
  271.     move    #$2000,$9c(a6)
  272.     move    #$2000,$9c(a6)    ;!!!
  273.     ifne    example
  274.     ifnd    makebin
  275.     move    #$fff,$180(a6)
  276.     endc
  277.     endc
  278.     bsr    P61_Music
  279.     ifne    example
  280.     ifnd    makebin
  281.     move    #0,$180(a6)
  282.     endc
  283.     endc
  284.     movem.l    (sp)+,d0-a6
  285.     nop
  286.     rte
  287.     endc
  288.     endc
  289.  
  290.     ifne    system
  291. P61_lev6server
  292.     movem.l    d2-d7/a2-a6,-(sp)
  293.     lea    P61_timeron(pc),a0
  294.     tst    (a0)
  295.     beq.b    P61_ohi
  296.  
  297.     lea    $dff000,a6
  298.     move    P61_server(pc),d0
  299.     beq.b    P61_musica
  300.     subq    #1,d0
  301.     beq    P61_dmason
  302.     bra    P61_setrepeat
  303.  
  304. P61_musica
  305.     bsr    P61_Music
  306.  
  307. P61_ohi    
  308.     movem.l    (sp)+,d2-d7/a2-a6
  309.     moveq    #1,d0
  310.     rts
  311.     endc
  312.  
  313. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  314. ;­ Call P61_Init to initialize the playroutine    ­
  315. ;­ D0 --> Timer detection (for CIA-version)    ­
  316. ;­ A0 --> Address to the module            ­
  317. ;­ A1 --> Address to samples/0 if in the module    ­
  318. ;­ A2 --> Address to sample buffer        ­
  319. ;­ D0 <-- 0 if succeeded            ­
  320. ;­ A6 <-- $DFF000                ­
  321. ;­         Uses D0-A6            ­
  322. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  323.  
  324. P61_Init
  325.     cmp.l    #"P61A",(a0)+
  326.     beq.b    .modok
  327.     subq.l    #4,a0
  328.  
  329. .modok
  330.     ifne    CIA
  331.     move    d0,-(sp)
  332.     endc
  333.  
  334.     moveq    #0,d0
  335.     cmp.l    d0,a1
  336.     bne.b    .redirect
  337.  
  338.     move    (a0),d0
  339.     lea    (a0,d0.l),a1
  340. .redirect
  341.     move.l    a2,a6
  342.     lea    8(a0),a2
  343.     moveq    #$40,d0
  344.     and.b    3(a0),d0
  345.     bne.b    .buffer
  346.     move.l    a1,a6
  347.     subq.l    #4,a2
  348. .buffer
  349.  
  350.     lea    P61_cn(pc),a3
  351.     moveq    #$1f,d1
  352.     and.b    3(a0),d1
  353.     move.l    a0,-(sp)
  354.     lea    P61_samples(pc),a4
  355.     subq    #1,d1
  356.     moveq    #0,d4
  357. P61_lopos
  358.     move.l    a6,(a4)+
  359.     move    (a2)+,d4
  360.     bpl.b    P61_kook
  361.     neg    d4
  362.     lea    P61_samples-16(pc),a5
  363.     ifeq    opt020
  364.     asl    #4,d4
  365.     move.l    (a5,d4),d6
  366.     else
  367.     add    d4,d4
  368.     move.l    (a5,d4*8),d6
  369.     endc
  370.     move.l    d6,-4(a4)
  371.     move    4(a5,d4),d4
  372.     sub.l    d4,a6
  373.     sub.l    d4,a6
  374.     bra.b    P61_jatk
  375.  
  376. P61_kook
  377.     move.l    a6,d6
  378.     tst.b    3(a0)
  379.     bpl.b    P61_jatk
  380.  
  381.     tst.b    (a2)
  382.     bmi.b    P61_jatk
  383.  
  384.     move    d4,d0
  385.     subq    #2,d0
  386.     bmi.b    P61_jatk
  387.  
  388.     move.l    a1,a5
  389.     move.b    (a5)+,d2
  390.     sub.b    (a5),d2
  391.     move.b    d2,(a5)+
  392. .loop    sub.b    (a5),d2
  393.     move.b    d2,(a5)+
  394.     sub.b    (a5),d2
  395.     move.b    d2,(a5)+
  396.     dbf    d0,.loop
  397.  
  398. P61_jatk
  399.     move    d4,(a4)+
  400.     moveq    #0,d2
  401.     move.b    (a2)+,d2
  402.     moveq    #0,d3
  403.     move.b    (a2)+,d3
  404.  
  405.     moveq    #0,d0
  406.     move    (a2)+,d0
  407.     bmi.b    .norepeat
  408.  
  409.     move    d4,d5
  410.     sub    d0,d5
  411.     move.l    d6,a5
  412.  
  413.     add.l    d0,a5
  414.     add.l    d0,a5
  415.  
  416.     move.l    a5,(a4)+
  417.     move    d5,(a4)+
  418.     bra.b    P61_gene
  419. .norepeat
  420.     move.l    d6,(a4)+
  421.     move    #1,(a4)+
  422. P61_gene
  423.     move    d3,(a4)+
  424.     moveq    #$f,d0
  425.     and    d2,d0
  426.     mulu    #74,d0
  427.     move    d0,(a4)+
  428.  
  429.     tst    -6(a2)
  430.     bmi.b    .nobuffer
  431.  
  432.     moveq    #$40,d0
  433.     and.b    3(a0),d0
  434.     beq.b    .nobuffer
  435.  
  436.     move    d4,d7
  437.     tst.b    d2
  438.     bpl.b    .copy
  439.  
  440.     subq    #1,d7
  441.     moveq    #0,d5
  442.     moveq    #0,d4
  443. .lo    move.b    (a1)+,d4
  444.     moveq    #$f,d3
  445.     and    d4,d3
  446.     lsr    #4,d4
  447.  
  448.     sub.b    .table(pc,d4),d5
  449.     move.b    d5,(a6)+
  450.     sub.b    .table(pc,d3),d5
  451.     move.b    d5,(a6)+
  452.     dbf    d7,.lo
  453.     bra.b    .kop
  454.  
  455. .copy
  456.     add    d7,d7
  457.     subq    #1,d7
  458. .cob
  459.     move.b    (a1)+,(a6)+
  460.     dbf    d7,.cob
  461.     bra.b    .kop
  462.  
  463. .table
  464.     dc.b    0,1,2,4,8,16,32,64,128,-64,-32,-16,-8,-4,-2,-1
  465.  
  466. .nobuffer
  467.     move.l    d4,d6
  468.     add.l    d6,d6
  469.     add.l    d6,a6
  470.     add.l    d6,a1
  471. .kop
  472.     dbf    d1,P61_lopos
  473.  
  474.     move.l    (sp)+,a0
  475.     and.b    #$7f,3(a0)
  476.  
  477.     move.l    a2,-(sp)
  478.  
  479.     lea    P61_temp0(pc),a1
  480.     lea    P61_temp1(pc),a2
  481.     lea    P61_temp2(pc),a4
  482.     lea    P61_temp3(pc),a5
  483.     moveq    #Channel_Block_SIZE/2-2,d0
  484.  
  485.     moveq    #0,d1
  486. .cl    move    d1,(a1)+
  487.     move    d1,(a2)+
  488.     move    d1,(a4)+
  489.     move    d1,(a5)+
  490.     dbf    d0,.cl
  491.  
  492.     lea    P61_temp0-P61_cn(a3),a1
  493.     lea    P61_emptysample-P61_cn(a3),a2
  494.     moveq    #channels-1,d0
  495. .loo    move.l    a2,P61_Sample(a1)        ;!!!
  496.     lea    Channel_Block_SIZE(a1),a1    ;!!!
  497. ;    move.l    a2,P61_Sample(a2)
  498.     dbf    d0,.loo
  499.  
  500.     move.l    (sp)+,a2
  501.     move.l    a2,P61_positionbase-P61_cn(a3)
  502.  
  503.     moveq    #$7f,d1
  504.     and.b    2(a0),d1
  505.  
  506.     ifeq    opt020
  507.     lsl    #3,d1
  508.     lea    (a2,d1.l),a4
  509.     else
  510.     lea    (a2,d1.l*8),a4
  511.     endc
  512.     move.l    a4,P61_possibase-P61_cn(a3)
  513.  
  514.     move.l    a4,a1
  515.     moveq    #-1,d0
  516. .search
  517.     cmp.b    (a1)+,d0
  518.     bne.b    .search
  519.     move.l    a1,P61_patternbase-P61_cn(a3)    
  520.     move.l    a1,d0
  521.     sub.l    a4,d0
  522.     move    d0,P61_slen-P61_cn(a3)
  523.  
  524.     ifd    start
  525.     lea    start(a4),a4
  526.     endc
  527.  
  528.     moveq    #0,d0
  529.     move.b    (a4)+,d0
  530.     move.l    a4,P61_spos-P61_cn(a3)
  531.     lsl    #3,d0
  532.     add.l    d0,a2
  533.  
  534.     move.l    a1,a4
  535.     moveq    #0,d0    
  536.     move    (a2)+,d0
  537.     lea    (a4,d0.l),a1
  538.     move.l    a1,P61_ChaPos+P61_temp0-P61_cn(a3)
  539.     move    (a2)+,d0
  540.     lea    (a4,d0.l),a1
  541.     move.l    a1,P61_ChaPos+P61_temp1-P61_cn(a3)
  542.     move    (a2)+,d0
  543.     lea    (a4,d0.l),a1
  544.     move.l    a1,P61_ChaPos+P61_temp2-P61_cn(a3)
  545.     move    (a2)+,d0
  546.     lea    (a4,d0.l),a1
  547.     move.l    a1,P61_ChaPos+P61_temp3-P61_cn(a3)
  548.  
  549.     lea    P61_setrepeat(pc),a0
  550.     move.l    a0,P61_intaddr-P61_cn(a3)
  551.  
  552.     move    #63,P61_rowpos-P61_cn(a3)
  553.     move    #6,P61_speed-P61_cn(a3)
  554.     move    #5,P61_speed2-P61_cn(a3)
  555.     clr    P61_speedis1-P61_cn(a3)
  556.  
  557.     ifne    P61_pl
  558.     clr.l    P61_plcount-P61_cn(a3)
  559.     endc
  560.  
  561.     ifne    P61_pde
  562.     clr    P61_pdelay-P61_cn(a3)
  563.     clr    P61_pdflag-P61_cn(a3)
  564.     endc
  565.     clr    (a3)
  566.  
  567.     moveq    #2,d0
  568.     and.b    $bfe001,d0
  569.     move.b    d0,P61_ofilter-P61_cn(a3)
  570.     bset    #1,$bfe001
  571.  
  572.     ifeq    system
  573.     ifne    exec
  574.     move.l    4.w,a6
  575.     moveq    #0,d0
  576.     btst    d0,297(a6)
  577.     beq.b    .no68010
  578.  
  579.     lea    P61_liko(pc),a5
  580.     jsr    -$1e(a6)
  581.  
  582. .no68010
  583.     move.l    d0,P61_VBR-P61_cn(a3)
  584.     endc
  585.  
  586.     move.l    P61_VBR-P61_cn(a3),a0
  587.     lea    $78(a0),a0
  588.     move.l    a0,P61_vektori-P61_cn(a3)
  589.  
  590.     move.l    (a0),P61_oldlev6-P61_cn(a3)
  591.     lea    P61_dmason(pc),a1
  592.     move.l    a1,(a0)
  593.     endc
  594.  
  595.     moveq    #0,d0
  596.     lea    $dff000,a6
  597.     move    d0,$a8(a6)
  598.     move    d0,$b8(a6)
  599.     move    d0,$c8(a6)
  600.     move    d0,$d8(a6)
  601.     move    #$f,$96(a6)
  602.  
  603.     ifeq    system
  604.     lea    P61_dmason(pc),a1
  605.     move.l    a1,(a0)
  606.     move    #$2000,$9a(a6)
  607.     lea    $bfd000,a0
  608.     lea    P61_timers(pc),a1
  609.     move.b    #$7f,$d00(a0)
  610.     move.b    #$10,$e00(a0)
  611.     move.b    #$10,$f00(a0)
  612.     move.b    $400(a0),(a1)+
  613.     move.b    $500(a0),(a1)+
  614.     move.b    $600(a0),(a1)+
  615.     move.b    $700(a0),(a1)
  616.     endc
  617.  
  618.     ifeq    system!CIA
  619.     move.b    #$82,$d00(a0)
  620.     endc
  621.  
  622.     ifne    CIA
  623.     move    (sp)+,d0
  624.     subq    #1,d0
  625.     beq.b    P61_ForcePAL
  626.     subq    #1,d0
  627.     beq.b    P61_NTSC
  628.     ifne    exec
  629.     move.l    4.w,a1
  630.     cmp.b    #60,$213(a1)    ;PowerSupplyFrequency
  631.     beq.b    P61_NTSC
  632.     endc
  633. P61_ForcePAL
  634.     move.l    #1773447,d0    ;PAL
  635.     bra.b    P61_setcia
  636. P61_NTSC
  637.     move.l    #1789773,d0    ;NTSC
  638. P61_setcia
  639.     move.l    d0,P61_timer-P61_cn(a3)
  640.     divu    #125,d0
  641.     move    d0,P61_thi2-P61_cn(a3)
  642.     sub    #$1f0*2,d0
  643.     move    d0,P61_thi-P61_cn(a3)
  644.  
  645.     ifeq    system
  646.     move    P61_thi2-P61_cn(a3),d0
  647.     move.b    d0,$400(a0)
  648.     lsr    #8,d0
  649.     move.b    d0,$500(a0)
  650.     lea    P61_intti(pc),a1
  651.     move.l    a1,P61_tintti-P61_cn(a3)
  652.     move.l    P61_vektori(pc),a2
  653.     move.l    a1,(a2)
  654.     move.b    #$83,$d00(a0)
  655.     move.b    #$11,$e00(a0)
  656.     endc
  657.     endc
  658.  
  659.     ifeq    system
  660.     move    #$e000,$9a(a6)
  661.     moveq    #0,d0
  662.     rts
  663.  
  664.     ifne    exec
  665. P61_liko
  666.     dc.l    $4E7A0801        ;MOVEC    VBR,d0
  667.     rte
  668.     endc
  669.     endc
  670.  
  671.     ifne    system
  672.     move.l    a6,-(sp)
  673.  
  674.     ifne    CIA
  675.     clr    P61_server-P61_cn(a3)
  676.     else
  677.     move    #1,P61_server-P61_cn(a3)
  678.     endc
  679.  
  680.     move.l    4.w,a6
  681.     moveq    #-1,d0
  682.     jsr    -$14a(a6)
  683.     move.b    d0,P61_sigbit-P61_cn(a3)
  684.     bmi    P61_err
  685.  
  686.     lea    P61_allocport(pc),a1
  687.     move.l    a1,P61_portti-P61_cn(a3)
  688.     move.b    d0,15(a1)
  689.     move.l    a1,-(sp)
  690.     suba.l    a1,a1
  691.     jsr    -$126(a6)
  692.     move.l    (sp)+,a1
  693.     move.l    d0,16(a1)
  694.     lea    P61_reqlist(pc),a0
  695.     move.l    a0,(a0)
  696.     addq.l    #4,(a0)
  697.     clr.l    4(a0)
  698.     move.l    a0,8(a0)
  699.  
  700.     lea    P61_dat(pc),a1
  701.     move.l    a1,P61_reqdata-P61_cn(a3)
  702.     lea    P61_allocreq(pc),a1
  703.     lea    P61_audiodev(pc),a0
  704.     moveq    #0,d0
  705.     moveq    #0,d1
  706.     jsr    -$1bc(a6)
  707.     tst.l    d0
  708.     bne    P61_err
  709.     st.b    P61_audioopen-P61_cn(a3)
  710.  
  711.     lea    P61_timerint(pc),a1
  712.     move.l    a1,P61_timerdata-P61_cn(a3)
  713.     lea    P61_lev6server(pc),a1
  714.     move.l    a1,P61_timerdata+8-P61_cn(a3)
  715.  
  716.     moveq    #0,d3
  717.     lea    P61_cianame(pc),a1
  718. P61_openciares
  719.     moveq    #0,d0
  720.     move.l    4.w,a6
  721.     jsr    -$1f2(a6)
  722.     move.l    d0,P61_ciares-P61_cn(a3)
  723.     beq.b    P61_err
  724.     move.l    d0,a6
  725.     lea    P61_timerinterrupt(pc),a1
  726.     moveq    #0,d0
  727.     jsr    -6(a6)
  728.     tst.l    d0
  729.     beq.b    P61_gottimer
  730.     addq.l    #4,d3
  731.     lea    P61_timerinterrupt(pc),a1
  732.     moveq    #1,d0
  733.     jsr    -6(a6)
  734.     tst.l    d0
  735.     bne.b    P61_err
  736.  
  737. P61_gottimer
  738.     lea    P61_craddr+8(pc),a6
  739.     move.l    P61_ciaaddr(pc,d3),d0
  740.     move.l    d0,(a6)
  741.     sub    #$100,d0
  742.     move.l    d0,-(a6)
  743.     moveq    #2,d3
  744.     btst    #9,d0
  745.     bne.b    P61_timerB
  746.     subq.b    #1,d3
  747.     add    #$100,d0
  748. P61_timerB
  749.     add    #$900,d0
  750.     move.l    d0,-(a6)
  751.     move.l    d0,a0
  752.     and.b    #%10000000,(a0)
  753.     move.b    d3,P61_timeropen-P61_cn(a3)
  754.     moveq    #0,d0
  755.     ifne    CIA
  756.     move.l    P61_craddr+4(pc),a1
  757.     move.b    P61_tlo(pc),(a1)
  758.     move.b    P61_thi(pc),$100(a1)
  759.     endc
  760.     or.b    #$19,(a0)
  761.     st    P61_timeron-P61_cn(a3)
  762. P61_pois
  763.     move.l    (sp)+,a6
  764.     rts
  765.  
  766. P61_err    moveq    #-1,d0
  767.     bra.b    P61_pois
  768.     rts
  769.  
  770. P61_ciaaddr
  771.     dc.l    $bfd500,$bfd700
  772.     endc
  773.  
  774. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  775. ;­         Call P61_End to stop the music        ­
  776. ;­   A6 --> Customchip baseaddress ($DFF000)    ­
  777. ;­        Uses D0/D1/A0/A1/A3        ­
  778. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  779.  
  780. P61_End
  781.     moveq    #0,d0
  782.     move    d0,$a8(a6)
  783.     move    d0,$b8(a6)
  784.     move    d0,$c8(a6)
  785.     move    d0,$d8(a6)
  786.     move    #$f,$96(a6)
  787.  
  788.     and.b    #~2,$bfe001
  789.     move.b    P61_ofilter(pc),d0
  790.     or.b    d0,$bfe001
  791.  
  792.     ifeq    system
  793.     move    #$2000,$9a(a6)
  794.     move.l    P61_vektori(pc),a0
  795.     move.l    P61_oldlev6(pc),(a0)
  796.     lea    $bfd000,a0
  797.     lea    P61_timers(pc),a1
  798.     move.b    (a1)+,$400(a0)
  799.     move.b    (a1)+,$500(a0)
  800.     move.b    (a1)+,$600(a0)
  801.     move.b    (a1)+,$700(a0)
  802.     move.b    #$10,$e00(a0)
  803.     move.b    #$10,$f00(a0)
  804.  
  805.     else
  806.  
  807.     clr    P61_timeron-P61_cn(a3)
  808.     move.l    a6,-(sp)
  809.     lea    P61_cn(pc),a3
  810.     moveq    #0,d0
  811.     move.b    P61_timeropen(pc),d0
  812.     beq.b    P61_rem1
  813.     move.l    P61_ciares(pc),a6
  814.     lea    P61_timerinterrupt(pc),a1
  815.     subq.b    #1,d0
  816.     jsr    -12(a6)
  817. P61_rem1
  818.     move.l    4.w,a6
  819.     tst.b    P61_audioopen-P61_cn(a3)
  820.     beq.b    P61_rem2
  821.     lea    P61_allocreq(pc),a1
  822.     jsr    -$1c2(a6)
  823.     clr.b    P61_audioopen-P61_cn(a3)
  824. P61_rem2
  825.     moveq    #0,d0
  826.     move.b    P61_sigbit(pc),d0
  827.     bmi.b    P61_rem3
  828.     jsr    -$150(a6)
  829.     st    P61_sigbit-P61_cn(a3)
  830. P61_rem3
  831.     move.l    (sp)+,a6
  832.     endc
  833.     rts
  834.  
  835.     ifne    fade
  836. P61_mfade
  837.     move    P61_Master(pc),d0
  838.     move    P61_temp0+P61_Shadow(pc),d1
  839.     mulu    d0,d1
  840.     lsr    #6,d1
  841.     move    d1,$a8(a6)
  842.  
  843.     ifgt    channels-1
  844.     move    P61_temp1+P61_Shadow(pc),d1
  845.     mulu    d0,d1
  846.     lsr    #6,d1
  847.     move    d1,$b8(a6)
  848.     endc
  849.  
  850.     ifgt    channels-2
  851.     move    P61_temp2+P61_Shadow(pc),d1
  852.     mulu    d0,d1
  853.     lsr    #6,d1
  854.     move    d1,$c8(a6)
  855.     endc
  856.  
  857.     ifgt    channels-3
  858.     move    P61_temp3+P61_Shadow(pc),d1
  859.     mulu    d0,d1
  860.     lsr    #6,d1
  861.     move    d1,$d8(a6)
  862.     endc
  863.     rts
  864.     endc
  865.     
  866.  
  867. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  868. ;­ Call P61_SetPosition to jump to a specific    ­
  869. ;­          position in the song.        ­
  870. ;­ D0.l --> Position                ­
  871. ;­ Starts from the beginning if out of limits.    ­
  872. ;­              Uses A0/A1/A3/D0-D3        ­
  873. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  874.  
  875.     ifne    jump
  876. P61_SetPosition
  877.     lea    P61_cn(pc),a3
  878.     ifne    P61_pl
  879.     clr    P61_plflag-P61_cn(a3)
  880.     endc
  881.     moveq    #0,d1
  882.     move.b    d0,d1
  883.     move.l    d1,d0
  884.     cmp    P61_slen-P61_cn(a3),d0
  885.     blo.b    .e
  886.     moveq    #0,d0
  887. .e    move    d0,P61_Pos-P61_cn(a3)
  888.     add.l    P61_possibase(pc),d0
  889.     move.l    d0,P61_spos-P61_cn(a3)
  890.  
  891.     moveq    #64,d0
  892.     move    d0,P61_rowpos-P61_cn(a3)
  893.     clr    P61_CRow-P61_cn(a3)
  894.     move.l    P61_spos(pc),a1
  895.     move.l    P61_patternbase(pc),a0
  896.     addq    #1,P61_Pos-P61_cn(a3)
  897.     move.b    (a1)+,d0
  898.     move.l    a1,P61_spos-P61_cn(a3)
  899.     move.l    P61_positionbase(pc),a1
  900.     move    d0,P61_Patt-P61_cn(a3)
  901.     lsl    #3,d0
  902.     add.l    d0,a1
  903.     movem    (a1),d0-d3
  904.     lea    (a0,d0.l),a1
  905.     move    d1,d0
  906.     move.l    a1,P61_ChaPos+P61_temp0-P61_cn(a3)
  907.     lea    (a0,d0.l),a1
  908.     move.l    a1,P61_ChaPos+P61_temp1-P61_cn(a3)
  909.     move    d2,d0
  910.     lea    (a0,d0.l),a1
  911.     move.l    a1,P61_ChaPos+P61_temp2-P61_cn(a3)
  912.     move    d3,d0
  913.     add.l    d0,a0
  914.     move.l    a0,P61_ChaPos+P61_temp3-P61_cn(a3)
  915.     rts
  916.     endc
  917.  
  918. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  919. ;­ Call P61_Music every frame to play the music    ­
  920. ;­      _NOT_ if CIA-version is used!        ­
  921. ;­ A6 --> Customchip baseaddress ($DFF000)    ­
  922. ;­              Uses A0-A5/D0-D7        ­
  923. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  924.  
  925. P61_Music
  926.     lea    P61_cn(pc),a3
  927.  
  928.     tst    P61_Play-P61_cn(a3)
  929.     bne.b    P61_ohitaaa
  930.     ifne    CIA
  931.     ifne    system
  932.     move.l    P61_craddr+4(pc),a0
  933.     move.b    P61_tlo2(pc),(a0)
  934.     move.b    P61_thi2(pc),$100(a0)
  935.     endc
  936.     endc
  937.     rts
  938.  
  939. P61_ohitaaa
  940.     ifne    fade
  941.     pea    P61_mfade(pc)
  942.     endc
  943.  
  944.     moveq    #Channel_Block_SIZE,d6
  945.     moveq    #16,d7
  946.  
  947.     move    (a3),d4
  948.     addq    #1,d4
  949.     cmp    P61_speed(pc),d4
  950.     beq    P61_playtime
  951.  
  952.     move    d4,(a3)
  953.  
  954. P61_delay
  955.     ifne    CIA
  956.     ifne    system
  957.     move.l    P61_craddr+4(pc),a0
  958.     move.b    P61_tlo2(pc),(a0)
  959.     move.b    P61_thi2(pc),$100(a0)
  960.     endc
  961.     endc
  962.  
  963.     lea    P61_temp0(pc),a5
  964.     lea    $a0(a6),a4
  965.  
  966.     moveq    #channels-1,d5
  967. P61_lopas
  968.     tst    P61_OnOff(a5)
  969.     beq    P61_contfxdone
  970.     moveq    #$f,d0
  971.     and    (a5),d0
  972.     ifeq    opt020
  973.     add    d0,d0
  974.     move    P61_jtab2(pc,d0),d0
  975.     else
  976.     move    P61_jtab2(pc,d0*2),d0
  977.     endc
  978.     jmp    P61_jtab2(pc,d0)
  979.  
  980. P61_jtab2
  981.     dc    P61_contfxdone-P61_jtab2
  982.  
  983.     ifne    P61_pu
  984.     dc    P61_portup-P61_jtab2
  985.     else
  986.     dc    P61_contfxdone-P61_jtab2
  987.     endc
  988.  
  989.     ifne    P61_pd
  990.     dc    P61_portdwn-P61_jtab2
  991.     else
  992.     dc    P61_contfxdone-P61_jtab2
  993.     endc
  994.  
  995.     ifne    P61_tp
  996.     dc    P61_toneport-P61_jtab2
  997.     else
  998.     dc    P61_contfxdone-P61_jtab2
  999.     endc
  1000.  
  1001.     ifne    P61_vib
  1002.     dc    P61_vib2-P61_jtab2
  1003.     else
  1004.     dc    P61_contfxdone-P61_jtab2
  1005.     endc
  1006.  
  1007.     ifne    P61_tpvs
  1008.     dc    P61_tpochvslide-P61_jtab2
  1009.     else
  1010.     dc    P61_contfxdone-P61_jtab2
  1011.     endc
  1012.  
  1013.     ifne    P61_vbvs
  1014.     dc    P61_vibochvslide-P61_jtab2
  1015.     else
  1016.     dc    P61_contfxdone-P61_jtab2
  1017.     endc
  1018.  
  1019.     ifne    P61_tre
  1020.     dc    P61_tremo-P61_jtab2
  1021.     else
  1022.     dc    P61_contfxdone-P61_jtab2
  1023.     endc
  1024.  
  1025.     ifne    P61_arp
  1026.     dc    P61_arpeggio-P61_jtab2
  1027.     else
  1028.     dc    P61_contfxdone-P61_jtab2
  1029.     endc
  1030.  
  1031.     dc    P61_contfxdone-P61_jtab2
  1032.  
  1033.     ifne    P61_vs
  1034.     dc    P61_volslide-P61_jtab2
  1035.     else
  1036.     dc    P61_contfxdone-P61_jtab2
  1037.     endc
  1038.  
  1039.     dc    P61_contfxdone-P61_jtab2
  1040.     dc    P61_contfxdone-P61_jtab2
  1041.     dc    P61_contfxdone-P61_jtab2
  1042.  
  1043.     ifne    P61_ec
  1044.     dc    P61_contecommands-P61_jtab2
  1045.     else
  1046.     dc    P61_contfxdone-P61_jtab2
  1047.     endc
  1048.     dc    P61_contfxdone-P61_jtab2
  1049.  
  1050.     ifne    P61_ec
  1051. P61_contecommands
  1052.     move.b    P61_Info(a5),d0
  1053.     and    #$f0,d0
  1054.     lsr    #3,d0
  1055.     move    P61_etab2(pc,d0),d0
  1056.     jmp    P61_etab2(pc,d0)
  1057.  
  1058. P61_etab2
  1059.     dc    P61_contfxdone-P61_etab2
  1060.  
  1061.     ifne    P61_fsu
  1062.     dc    P61_fineup2-P61_etab2
  1063.     else
  1064.     dc    P61_contfxdone-P61_etab2
  1065.     endc
  1066.  
  1067.     ifne    P61_fsd
  1068.     dc    P61_finedwn2-P61_etab2
  1069.     else
  1070.     dc    P61_contfxdone-P61_etab2
  1071.     endc
  1072.  
  1073.     dc    P61_contfxdone-P61_etab2
  1074.     dc    P61_contfxdone-P61_etab2
  1075.  
  1076.     dc    P61_contfxdone-P61_etab2
  1077.     dc    P61_contfxdone-P61_etab2
  1078.  
  1079.     dc    P61_contfxdone-P61_etab2
  1080.     dc    P61_contfxdone-P61_etab2
  1081.  
  1082.     ifne    P61_rt
  1083.     dc    P61_retrig-P61_etab2
  1084.     else
  1085.     dc    P61_contfxdone-P61_etab2
  1086.     endc
  1087.  
  1088.     ifne    P61_fvu
  1089.     dc    P61_finevup2-P61_etab2
  1090.     else
  1091.     dc    P61_contfxdone-P61_etab2
  1092.     endc
  1093.  
  1094.     ifne    P61_fvd
  1095.     dc    P61_finevdwn2-P61_etab2
  1096.     else
  1097.     dc    P61_contfxdone-P61_etab2
  1098.     endc
  1099.  
  1100.     ifne    P61_nc
  1101.     dc    P61_notecut-P61_etab2
  1102.     else
  1103.     dc    P61_contfxdone-P61_etab2
  1104.     endc
  1105.  
  1106.     ifne    P61_nd
  1107.     dc    P61_notedelay-P61_etab2
  1108.     else
  1109.     dc    P61_contfxdone-P61_etab2
  1110.     endc
  1111.  
  1112.     dc    P61_contfxdone-P61_etab2
  1113.     dc    P61_contfxdone-P61_etab2
  1114.     endc
  1115.  
  1116.     ifne    P61_fsu
  1117. P61_fineup2
  1118.     tst    (a3)
  1119.     bne    P61_contfxdone
  1120.     moveq    #$f,d0
  1121.     and.b    P61_Info(a5),d0
  1122.     sub    d0,P61_Period(a5)
  1123.     moveq    #113,d0
  1124.     cmp    P61_Period(a5),d0
  1125.     ble.b    .jup
  1126.     move    d0,P61_Period(a5)
  1127. .jup    move    P61_Period(a5),6(a4)
  1128.     bra    P61_contfxdone
  1129.     endc
  1130.  
  1131.     ifne    P61_fsd
  1132. P61_finedwn2
  1133.     tst    (a3)
  1134.     bne    P61_contfxdone
  1135.     moveq    #$f,d0
  1136.     and.b    P61_Info(a5),d0
  1137.     add    d0,P61_Period(a5)
  1138.     cmp    #856,P61_Period(a5)
  1139.     ble.b    .jup
  1140.     move    #856,P61_Period(a5)
  1141. .jup    move    P61_Period(a5),6(a4)
  1142.     bra    P61_contfxdone
  1143.     endc
  1144.  
  1145.     ifne    P61_fvu
  1146. P61_finevup2
  1147.     tst    (a3)
  1148.     bne    P61_contfxdone
  1149.     moveq    #$f,d0
  1150.     and.b    P61_Info(a5),d0
  1151.     add    d0,P61_Volume(a5)
  1152.     moveq    #64,d0
  1153.     cmp    P61_Volume(a5),d0
  1154.     bge.b    .jup
  1155.     move    d0,P61_Volume(a5)
  1156. .jup    move    P61_Volume(a5),8(a4)
  1157.     bra    P61_contfxdone
  1158.     endc
  1159.  
  1160.     ifne    P61_fvd
  1161. P61_finevdwn2
  1162.     tst    (a3)
  1163.     bne    P61_contfxdone
  1164.     moveq    #$f,d0
  1165.     and.b    P61_Info(a5),d0
  1166.     sub    d0,P61_Volume(a5)
  1167.     bpl.b    .jup
  1168.     clr    P61_Volume(a5)
  1169. .jup    move    P61_Volume(a5),8(a4)
  1170.     bra    P61_contfxdone
  1171.     endc
  1172.  
  1173.     ifne    P61_nc
  1174. P61_notecut
  1175.     moveq    #$f,d0
  1176.     and.b    P61_Info(a5),d0
  1177.     cmp    (a3),d0
  1178.     bne    P61_contfxdone
  1179.     ifeq    fade
  1180.     clr    8(a4)
  1181.     else
  1182.     clr    P61_Shadow(a5)
  1183.     endc
  1184.     clr    P61_Volume(a5)
  1185.     bra    P61_contfxdone
  1186.     endc
  1187.  
  1188.     ifne    P61_nd
  1189. P61_notedelay
  1190.     moveq    #$f,d0
  1191.     and.b    P61_Info(a5),d0
  1192.     cmp    (a3),d0
  1193.     bne    P61_contfxdone
  1194.  
  1195.     moveq    #$7e,d0
  1196.     and.b    (a5),d0
  1197.     beq    P61_contfxdone
  1198.     move    P61_DMABit(a5),d0
  1199.     move    d0,$96(a6)
  1200.     or    d0,P61_dma-P61_cn(a3)
  1201.     move.l    P61_Sample(a5),a1        ;* Trigger *
  1202.     move.l    (a1)+,(a4)+            ;Pointer
  1203.     move    (a1),(a4)+            ;Length
  1204.     move    P61_Period(a5),(a4)
  1205.     subq.l    #6,a4
  1206.  
  1207.     ifeq    system
  1208.     lea    P61_dmason(pc),a1
  1209.     move.l    P61_vektori(pc),a0
  1210.     move.l    a1,(a0)
  1211.     move.b    #$f0,$bfd600
  1212.     move.b    #$01,$bfd700
  1213.     move.b    #$19,$bfdf00
  1214.     else
  1215.     move    #1,P61_server-P61_cn(a3)
  1216.     move.l    P61_craddr+4(pc),a1
  1217.     move.b    #$f0,(a1)
  1218.     move.b    #1,$100(a1)
  1219.     endc
  1220.     bra    P61_contfxdone
  1221.     endc
  1222.  
  1223.     ifne    P61_rt
  1224. P61_retrig
  1225.     subq    #1,P61_RetrigCount(a5)
  1226.     bne    P61_contfxdone
  1227.     move    P61_DMABit(a5),d0
  1228.     move    d0,$96(a6)
  1229.     or    d0,P61_dma-P61_cn(a3)
  1230.     move.l    P61_Sample(a5),a1        ;* Trigger *
  1231.     move.l    (a1)+,(a4)            ;Pointer
  1232.     move    (a1),4(a4)            ;Length
  1233.  
  1234.     ifeq    system
  1235.     lea    P61_dmason(pc),a1
  1236.     move.l    P61_vektori(pc),a0
  1237.     move.l    a1,(a0)
  1238.     move.b    #$f0,$bfd600
  1239.     move.b    #$01,$bfd700
  1240.     move.b    #$19,$bfdf00
  1241.     else
  1242.     move    #1,P61_server-P61_cn(a3)
  1243.     move.l    P61_craddr+4(pc),a1
  1244.     move.b    #$f0,(a1)
  1245.     move.b    #1,$100(a1)
  1246.     endc
  1247.  
  1248.     moveq    #$f,d0
  1249.     and.b    P61_Info(a5),d0
  1250.     move    d0,P61_RetrigCount(a5)
  1251.     bra    P61_contfxdone
  1252.     endc
  1253.  
  1254.     ifne    P61_arp
  1255. P61_arplist
  1256.  dc.b 0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1
  1257.  
  1258. P61_arpeggio
  1259.     move    (a3),d0
  1260.     move.b    P61_arplist(pc,d0),d0
  1261.     beq.b    .arp0
  1262.     bmi.b    .arp1
  1263.  
  1264.     move.b    P61_Info(a5),d0
  1265.     lsr    #4,d0
  1266.     bra.b    .arp3
  1267.  
  1268. .arp0
  1269.     move    P61_Note(a5),d0
  1270.     move    P61_periods(pc,d0),6(a4)
  1271.     bra    P61_contfxdone
  1272.  
  1273. .arp1
  1274.     moveq    #$f,d0
  1275.     and.b    P61_Info(a5),d0
  1276.  
  1277. .arp3
  1278.     add    d0,d0
  1279.     add    P61_Note(a5),d0
  1280.     move    P61_periods(pc,d0),6(a4)
  1281.     bra    P61_contfxdone
  1282.     endc
  1283.  
  1284. P61_periods
  1285.     ifne    P61_ft
  1286.     incbin    periods
  1287.     else
  1288.     incbin    periods.nft
  1289.     endc
  1290.  
  1291.     ifne    P61_vs
  1292. P61_volslide
  1293.     move.b    P61_Info(a5),d0
  1294.     sub.b    d0,P61_Volume+1(a5)
  1295.     bpl.b    .test
  1296.     clr    P61_Volume(a5)
  1297.     ifeq    fade
  1298.     clr    8(a4)
  1299.     else
  1300.     clr    P61_Shadow(a5)
  1301.     endc
  1302.     bra    P61_contfxdone
  1303. .test
  1304.     moveq    #64,d0
  1305.     cmp    P61_Volume(a5),d0
  1306.     bge.b    .ncs
  1307.     move    d0,P61_Volume(a5)
  1308.     ifeq    fade
  1309.     move    d0,8(a4)
  1310.     else
  1311.     move    d0,P61_Shadow(a5)
  1312.     endc
  1313.     bra.b    P61_contfxdone
  1314. .ncs
  1315.     ifeq    fade
  1316.     move    P61_Volume(a5),8(a4)
  1317.     else
  1318.     move    P61_Volume(a5),P61_Shadow(a5)
  1319.     endc
  1320.     bra.b    P61_contfxdone
  1321.     endc
  1322.  
  1323.     ifne    P61_tpvs
  1324. P61_tpochvslide
  1325.     move.b    P61_Info(a5),d0
  1326.     sub.b    d0,P61_Volume+1(a5)
  1327.     bpl.b    .test
  1328.     clr    P61_Volume(a5)
  1329.     ifeq    fade
  1330.     clr    8(a4)
  1331.     else
  1332.     clr    P61_Shadow(a5)
  1333.     endc
  1334.     bra.b    P61_toneport
  1335. .test
  1336.     moveq    #64,d0
  1337.     cmp    P61_Volume(a5),d0
  1338.     bge.b    .ncs
  1339.     move    d0,P61_Volume(a5)
  1340. .ncs
  1341.     ifeq    fade
  1342.     move    P61_Volume(a5),8(a4)
  1343.     else
  1344.     move    P61_Volume(a5),P61_Shadow(a5)
  1345.     endc
  1346.     endc
  1347.  
  1348.     ifne    P61_tp
  1349. P61_toneport
  1350.     move    P61_ToPeriod(a5),d0
  1351.     beq.b    P61_contfxdone
  1352.     move    P61_TPSpeed(a5),d1
  1353.     cmp    P61_Period(a5),d0
  1354.     blt    .topoup
  1355.  
  1356.     add    d1,P61_Period(a5)
  1357.     cmp    P61_Period(a5),d0
  1358.     bgt.b    .setper
  1359.     move    d0,P61_Period(a5)
  1360.     clr    P61_ToPeriod(a5)
  1361.     move    d0,6(a4)
  1362.     bra    P61_contfxdone
  1363.  
  1364. .topoup
  1365.     sub    d1,P61_Period(a5)
  1366.     cmp    P61_Period(a5),d0
  1367.     blt.b    .setper
  1368.     move    d0,P61_Period(a5)
  1369.     clr    P61_ToPeriod(a5)
  1370. .setper
  1371.     move    P61_Period(a5),6(a4)
  1372.     else
  1373.     nop
  1374.     endc
  1375.  
  1376. P61_contfxdone
  1377.     ifne    P61_il
  1378.     bsr    P61_funk2
  1379.     endc
  1380.  
  1381.     add.l    d6,a5
  1382.     add.l    d7,a4
  1383.     dbf    d5,P61_lopas
  1384.  
  1385.     cmp    P61_speed2(pc),d4
  1386.     beq.b    P61_preplay
  1387.     rts
  1388.  
  1389.     ifne    P61_pu
  1390. P61_portup
  1391.     moveq    #0,D0
  1392.     move.b    P61_Info(a5),d0
  1393.     sub    d0,P61_Period(a5)
  1394.     moveq    #113,d0
  1395.     cmp    P61_Period(a5),d0
  1396.     ble.b    .skip
  1397.     move    d0,P61_Period(a5)
  1398.     move    d0,6(a4)
  1399.     bra.b    P61_contfxdone
  1400. .skip
  1401.     move    P61_Period(a5),6(a4)
  1402.     bra.b    P61_contfxdone
  1403.     endc
  1404.  
  1405.     ifne    P61_pd
  1406. P61_portdwn
  1407.     moveq    #0,d0
  1408.     move.b    P61_Info(a5),d0
  1409.     add    d0,P61_Period(a5)
  1410.     cmp    #856,P61_Period(a5)
  1411.     ble.b    .skip
  1412.     move    #856,d0
  1413.     move    d0,P61_Period(a5)
  1414.     move    d0,6(a4)
  1415.     bra.b    P61_contfxdone
  1416. .skip
  1417.     move    P61_Period(a5),6(a4)
  1418.     bra.b    P61_contfxdone
  1419.     endc
  1420.  
  1421.     ifne    P61_pde
  1422. P61_return
  1423.     rts
  1424.  
  1425. P61_preplay
  1426.     tst    P61_pdflag-P61_cn(a3)
  1427.     bne.b    P61_return
  1428.     else
  1429. P61_preplay
  1430.     endc
  1431.  
  1432.     lea    P61_temp0(pc),a5
  1433.     lea    P61_samples-16(pc),a0
  1434.  
  1435.     moveq    #channels-1,d5
  1436. P61_loaps
  1437.     ifne    P61_pl
  1438.     lea    P61_TData(a5),a1
  1439.     move    2(a5),(a1)+
  1440.     move.l    P61_ChaPos(a5),(a1)+
  1441.     move.l    P61_TempPos(a5),(a1)+
  1442.     move    P61_TempLen(a5),(a1)
  1443.     endc
  1444.  
  1445.     move.b    P61_Pack(a5),d0
  1446.     and.b    #$3f,d0
  1447.     beq.b    P61_takeone
  1448.  
  1449.     tst.b    P61_Pack(a5)
  1450.     bmi.b    .keepsame
  1451.  
  1452.     subq.b    #1,P61_Pack(a5)
  1453.     clr    P61_OnOff(a5)            ; Empty row
  1454.     add.l    d6,a5
  1455.     dbf    d5,P61_loaps
  1456.     rts
  1457.  
  1458. .keepsame
  1459.     subq.b    #1,P61_Pack(a5)
  1460.     bra    P61_dko
  1461.  
  1462. P61_takeone
  1463.     tst.b    P61_TempLen+1(a5)
  1464.     beq.b    P61_takenorm
  1465.  
  1466.     subq.b    #1,P61_TempLen+1(a5)
  1467.     move.l    P61_TempPos(a5),a2
  1468.  
  1469. P61_jedi
  1470.     move.b    (a2)+,d0
  1471.     moveq    #%01100000,d1
  1472.     and.b    d0,d1
  1473.     cmp.b    #%01100000,d1
  1474.     bne.b    .all
  1475.  
  1476.     moveq    #%01110000,d1
  1477.     and.b    d0,d1
  1478.     cmp.b    #%01110000,d1
  1479.     bne.b    .cmd
  1480.  
  1481.     moveq    #%01111000,d1
  1482.     and.b    d0,d1
  1483.     cmp.b    #%01111000,d1
  1484.     bne.b    .note
  1485.  
  1486. .empty
  1487.     clr    P61_OnOff(a5)            ; Empty row
  1488.     clr    (a5)+
  1489.     clr.b    (a5)+
  1490.     tst.b    d0
  1491.     bpl.b    .ex
  1492.     move.b    (a2)+,(a5)            ; Compression info
  1493.     bra.b    .ex
  1494.  
  1495. .all
  1496.     move.b    d0,(a5)+
  1497.     ifeq    opt020
  1498.     move.b    (a2)+,(a5)+
  1499.     move.b    (a2)+,(a5)+
  1500.     else
  1501.     move    (a2)+,(a5)+
  1502.     endc
  1503.     tst.b    d0
  1504.     bpl.b    .ex
  1505.     move.b    (a2)+,(a5)            ; Compression info
  1506.     bra.b    .ex
  1507.  
  1508. .cmd
  1509.     moveq    #$f,d1
  1510.     and    d0,d1
  1511.     move    d1,(a5)+            ; cmd
  1512.     move.b    (a2)+,(a5)+            ; info
  1513.     tst.b    d0
  1514.     bpl    .ex
  1515.     move.b    (a2)+,(a5)            ; Compression info
  1516.     bra.b    .ex
  1517.  
  1518. .note
  1519.     moveq    #7,d1
  1520.     and    d0,d1
  1521.     lsl    #8,d1
  1522.     move.b    (a2)+,d1
  1523.     lsl    #4,d1
  1524.     move    d1,(a5)+
  1525.     clr.b    (a5)+    
  1526.     tst.b    d0
  1527.     bpl.b    .ex
  1528.     move.b    (a2)+,(a5)            ; Compression info
  1529. .ex
  1530.     subq.l    #3,a5
  1531.     move.l    a2,P61_TempPos(a5)
  1532.     bra    P61_dko
  1533.  
  1534.  
  1535. P61_takenorm
  1536.     move.l    P61_ChaPos(a5),a2
  1537.  
  1538.     move.b    (a2)+,d0
  1539.     moveq    #%01100000,d1
  1540.     and.b    d0,d1
  1541.     cmp.b    #%01100000,d1
  1542.     bne.b    .all
  1543.  
  1544.     moveq    #%01110000,d1
  1545.     and.b    d0,d1
  1546.     cmp.b    #%01110000,d1
  1547.     bne.b    .cmd
  1548.  
  1549.     moveq    #%01111000,d1
  1550.     and.b    d0,d1
  1551.     cmp.b    #%01111000,d1
  1552.     bne.b    .note
  1553.  
  1554. .empty
  1555.     clr    P61_OnOff(a5)            ; Empty row
  1556.     clr    (a5)+
  1557.     clr.b    (a5)+
  1558.     tst.b    d0
  1559.     bpl.b    .proccomp
  1560.     move.b    (a2)+,(a5)            ; Compression info
  1561.     bra.b    .proccomp
  1562.  
  1563.  
  1564. .all
  1565.     move.b    d0,(a5)+
  1566.     ifeq    opt020
  1567.     move.b    (a2)+,(a5)+
  1568.     move.b    (a2)+,(a5)+
  1569.     else
  1570.     move    (a2)+,(a5)+
  1571.     endc
  1572.     tst.b    d0
  1573.     bpl.b    .proccomp
  1574.     move.b    (a2)+,(a5)            ; Compression info
  1575.     bra.b    .proccomp
  1576.  
  1577. .cmd
  1578.     moveq    #$f,d1
  1579.     and    d0,d1
  1580.     move    d1,(a5)+            ; cmd
  1581.     move.b    (a2)+,(a5)+            ; info
  1582.     tst.b    d0
  1583.     bpl    .proccomp
  1584.     move.b    (a2)+,(a5)            ; Compression info
  1585.     bra.b    .proccomp
  1586.  
  1587. .note
  1588.     moveq    #7,d1
  1589.     and    d0,d1
  1590.     lsl    #8,d1
  1591.     move.b    (a2)+,d1
  1592.     lsl    #4,d1
  1593.     move    d1,(a5)+
  1594.     clr.b    (a5)+    
  1595.     tst.b    d0
  1596.     bpl.b    .proccomp
  1597.     move.b    (a2)+,(a5)            ; Compression info
  1598.  
  1599. .proccomp
  1600.     subq.l    #3,a5
  1601.     move.l    a2,P61_ChaPos(a5)
  1602.  
  1603.     tst.b    d0
  1604.     bpl.b    P61_dko
  1605.  
  1606.     move.b    3(a5),d0
  1607.     move.b    d0,d1
  1608.     and    #%11000000,d1
  1609.     beq.b    P61_dko                ; Empty datas
  1610.     cmp.b    #%10000000,d1
  1611.     beq.b    P61_dko                ; Same datas
  1612.  
  1613.     clr.b    3(a5)
  1614.     and    #$3f,d0
  1615.     move.b    d0,P61_TempLen+1(a5)
  1616.  
  1617.     cmp.b    #%11000000,d1
  1618.     beq.b    .bit16                ; 16-bit
  1619.  
  1620.     moveq    #0,d0                ; 8-bit
  1621.     move.b    (a2)+,d0
  1622.     move.l    a2,P61_ChaPos(a5)
  1623.     sub.l    d0,a2
  1624.     bra    P61_jedi
  1625.  
  1626. .bit16
  1627.     moveq    #0,d0
  1628.     ifeq    opt020
  1629.     move.b    (a2)+,d0
  1630.     lsl    #8,d0
  1631.     move.b    (a2)+,d0
  1632.     else
  1633.     move    (a2)+,d0
  1634.     endc
  1635.  
  1636.     move.l    a2,P61_ChaPos(a5)
  1637.     sub.l    d0,a2
  1638.     bra    P61_jedi
  1639.  
  1640.  
  1641. P61_dko
  1642.     st    P61_OnOff(a5)
  1643.     move    (a5),d0
  1644.     and    #$1f0,d0
  1645.     beq    .koto
  1646.     lea    (a0,d0),a1
  1647.     move.l    a1,P61_Sample(a5)
  1648.     ifne    P61_ft
  1649.     move.l    P61_SampleVolume(a1),P61_Volume(a5)
  1650.     else
  1651.     move    P61_SampleVolume(a1),P61_Volume(a5)
  1652.     endc
  1653.     ifne    P61_il
  1654.     move.l    P61_RepeatOffset(a1),P61_Wave(a5)
  1655.     endc
  1656.     ifne    P61_sof
  1657.     clr    P61_Offset(a5)
  1658.     endc
  1659.  
  1660. .koto
  1661.     add.l    d6,a5
  1662.     dbf    d5,P61_loaps
  1663.     rts
  1664.  
  1665. P61_playtime
  1666.     clr    (a3)
  1667.  
  1668.     ifne    P61_pde
  1669.     tst    P61_pdelay-P61_cn(a3)
  1670.     beq    .djdj
  1671.     subq    #1,P61_pdelay-P61_cn(a3)
  1672.     bne    P61_delay
  1673.     tst    P61_speedis1-P61_cn(a3)
  1674.     bne    P61_delay
  1675.     clr    P61_pdflag-P61_cn(a3)
  1676.     bra    P61_delay
  1677. .djdj
  1678.     clr    P61_pdflag-P61_cn(a3)
  1679.     endc
  1680.  
  1681.     tst    P61_speedis1-P61_cn(a3)
  1682.     beq.b    .mo
  1683.     bsr    P61_preplay
  1684.  
  1685. .mo
  1686.     lea    P61_temp0(pc),a5
  1687.     lea    $a0(a6),a4
  1688.  
  1689.     ifeq    system
  1690.     lea    P61_dmason(pc),a1
  1691.     move.l    P61_vektori(pc),a0
  1692.     move.l    a1,(a0)
  1693.     move.b    #$f0,$bfd600
  1694.     move.b    #$01,$bfd700
  1695.     move.b    #$19,$bfdf00
  1696.     else
  1697.     move    #1,P61_server-P61_cn(a3)
  1698.     move.l    P61_craddr+4(pc),a1
  1699.     move.b    #$f0,(a1)
  1700.     move.b    #1,$100(a1)
  1701.     endc
  1702.  
  1703.     lea    P61_periods(pc),a2
  1704.  
  1705.     moveq    #0,d4
  1706.     moveq    #channels-1,d5
  1707. P61_los
  1708.     tst    P61_OnOff(a5)
  1709.     beq.b    P61_nocha
  1710.  
  1711.     moveq    #$f,d0
  1712.     and    (a5),d0
  1713.     lea    P61_jtab(pc),a1
  1714.     add    d0,d0
  1715.     add.l    d0,a1
  1716.     add    (a1),a1
  1717.     jmp    (a1)
  1718.  
  1719. P61_fxdone
  1720.     moveq    #$7e,d0
  1721.     and.b    (a5),d0
  1722.     beq.b    P61_nocha
  1723.     ifne    P61_vib
  1724.     clr.b    P61_VibPos(a5)
  1725.     endc
  1726.     ifne    P61_tre
  1727.     clr.b    P61_TrePos(a5)
  1728.     endc
  1729.  
  1730.      ifne    P61_ft
  1731.     add    P61_Fine(a5),d0
  1732.     endc
  1733.     move    d0,P61_Note(a5)
  1734.     move    (a2,d0),P61_Period(a5)
  1735.  
  1736. P61_zample
  1737.     ifne    P61_sof
  1738.     tst    P61_Offset(a5)
  1739.     bne    P61_pek
  1740.     endc
  1741.  
  1742.     or    P61_DMABit(a5),d4
  1743.     move    d4,$96(a6)
  1744.     move.l    P61_Sample(a5),a1        ;* Trigger *
  1745.     move.l    (a1)+,(a4)            ;Pointer
  1746.     move    (a1),4(a4)            ;Length
  1747.  
  1748. P61_nocha
  1749.     ifeq    fade
  1750.     move.l    P61_Period(a5),6(a4)
  1751.     else
  1752.     move    P61_Period(a5),6(a4)
  1753.     move    P61_Volume(a5),P61_Shadow(a5)
  1754.     endc
  1755.  
  1756. P61_skip
  1757.     ifne    P61_il
  1758.     bsr    P61_funk2
  1759.     endc
  1760.  
  1761.     add.l    d6,a5
  1762.     add.l    d7,a4
  1763.     dbf    d5,P61_los
  1764.  
  1765.     move.b    d4,P61_dma+1-P61_cn(a3)
  1766.  
  1767.     ifne    P61_pl
  1768.     tst.b    P61_plflag+1-P61_cn(a3)
  1769.     beq.b    P61_ohittaa
  1770.  
  1771.     lea    P61_temp0(pc),a1
  1772.     lea    P61_looppos(pc),a0
  1773.     moveq    #channels-1,d0
  1774. .talt
  1775.     move.b    1(a0),3(a1)
  1776.     addq.l    #2,a0
  1777.     move.l    (a0)+,P61_ChaPos(a1)
  1778.     move.l    (a0)+,P61_TempPos(a1)
  1779.     move    (a0)+,P61_TempLen(a1)
  1780.     add.l    d6,a1
  1781.     dbf    d0,.talt
  1782.  
  1783.     move    P61_plrowpos(pc),P61_rowpos-P61_cn(a3)
  1784.     clr.b    P61_plflag+1-P61_cn(a3)
  1785.     moveq    #63,d0
  1786.     sub    P61_rowpos-P61_cn(a3),d0
  1787.     move    d0,P61_CRow-P61_cn(a3)
  1788.     rts
  1789.     endc
  1790.  
  1791. P61_ohittaa
  1792.     subq    #1,P61_rowpos-P61_cn(a3)
  1793.     bmi.b    P61_nextpattern
  1794.     moveq    #63,d0
  1795.     sub    P61_rowpos-P61_cn(a3),d0
  1796.     move    d0,P61_CRow-P61_cn(a3)
  1797.     rts
  1798.  
  1799. P61_nextpattern
  1800.     ifne    P61_pl
  1801.     clr    P61_plflag-P61_cn(a3)
  1802.     endc
  1803.     move.l    P61_patternbase(pc),a4
  1804.     moveq    #63,d0
  1805.     move    d0,P61_rowpos-P61_cn(a3)
  1806.     clr    P61_CRow-P61_cn(a3)
  1807.     move.l    P61_spos(pc),a1
  1808.     addq    #1,P61_Pos-P61_cn(a3)
  1809.     move.b    (a1)+,d0
  1810.     bpl.b    P61_dk
  1811.     move.l    P61_possibase(pc),a1
  1812.     move.b    (a1)+,d0
  1813.     clr    P61_Pos-P61_cn(a3)
  1814. P61_dk
  1815.     move.l    a1,P61_spos-P61_cn(a3)
  1816.     move    d0,P61_Patt-P61_cn(a3)
  1817.     lsl    #3,d0
  1818.     move.l    P61_positionbase(pc),a1
  1819.     add.l    d0,a1
  1820.  
  1821.     move    (a1)+,d0
  1822.     lea    (a4,d0.l),a2
  1823.     move.l    a2,P61_ChaPos+P61_temp0-P61_cn(a3)
  1824.     move    (a1)+,d0
  1825.     lea    (a4,d0.l),a2
  1826.     move.l    a2,P61_ChaPos+P61_temp1-P61_cn(a3)
  1827.     move    (a1)+,d0
  1828.     lea    (a4,d0.l),a2
  1829.     move.l    a2,P61_ChaPos+P61_temp2-P61_cn(a3)
  1830.     move    (a1),d0
  1831.     add.l    d0,a4
  1832.     move.l    a4,P61_ChaPos+P61_temp3-P61_cn(a3)
  1833.     rts
  1834.  
  1835.     ifne    P61_tp
  1836. P61_settoneport
  1837.     move.b    P61_Info(a5),d0
  1838.     beq.b    P61_toponochange
  1839.     move.b    d0,P61_TPSpeed+1(a5)
  1840. P61_toponochange
  1841.     moveq    #$7e,d0
  1842.     and.b    (a5),d0
  1843.     beq    P61_nocha
  1844.     add    P61_Fine(a5),d0
  1845.     move    d0,P61_Note(a5)
  1846.     move    (a2,d0),P61_ToPeriod(a5)
  1847.     bra    P61_nocha
  1848.     endc
  1849.  
  1850.     ifne    P61_sof
  1851. P61_sampleoffse
  1852.     moveq    #0,d1
  1853.     move    #$ff00,d1
  1854.     and    2(a5),d1
  1855.     bne.b    .deq
  1856.     move    P61_LOffset(a5),d1
  1857. .deq
  1858.     move    d1,P61_LOffset(a5)
  1859.     add    d1,P61_Offset(a5)
  1860.  
  1861.     moveq    #$7e,d0
  1862.     and.b    (a5),d0
  1863.     beq    P61_nocha
  1864.  
  1865.     move    P61_Offset(a5),d2
  1866.     add    d1,P61_Offset(a5)        ; THIS IS A PT-FEATURE!
  1867.     move    d2,d1
  1868.  
  1869.     ifne    P61_vib
  1870.     clr.b    P61_VibPos(a5)
  1871.     endc
  1872.     ifne    P61_tre
  1873.     clr.b    P61_TrePos(a5)
  1874.     endc
  1875.  
  1876.     ifne    P61_ft
  1877.     add    P61_Fine(a5),d0
  1878.     endc
  1879.     move    d0,P61_Note(a5)
  1880.     move    (a2,d0),P61_Period(a5)
  1881.     bra.b    P61_hup
  1882.  
  1883. P61_pek
  1884.     moveq    #0,d1
  1885.     move    P61_Offset(a5),d1
  1886. P61_hup
  1887.     or    P61_DMABit(a5),d4
  1888.     move    d4,$96(a6)
  1889.     move.l    P61_Sample(a5),a1        ;* Trigger *
  1890.     move.l    (a1)+,d0
  1891.     add.l    d1,d0
  1892.     move.l    d0,(a4)                ;Pointer
  1893.     lsr    #1,d1
  1894.     move    (a1),d0
  1895.     sub    d1,d0
  1896.     bpl.b    P61_offok
  1897.     move.l    -4(a1),(a4)            ;Pointer is over the end
  1898.     moveq    #1,d0
  1899. P61_offok
  1900.     move    d0,4(a4)            ;Length
  1901.     bra    P61_nocha
  1902.     endc
  1903.  
  1904.     ifne    P61_vl
  1905. P61_volum
  1906.     move.b    P61_Info(a5),P61_Volume+1(a5)
  1907.     bra    P61_fxdone
  1908.     endc
  1909.  
  1910.     ifne    P61_pj
  1911. P61_posjmp
  1912.     moveq    #0,d0
  1913.     move.b    P61_Info(a5),d0
  1914.     cmp    P61_slen-P61_cn(a3),d0
  1915.     blo.b    .e
  1916.     moveq    #0,d0
  1917. .e    move    d0,P61_Pos-P61_cn(a3)
  1918.     add.l    P61_possibase(pc),d0
  1919.     move.l    d0,P61_spos-P61_cn(a3)
  1920.     endc
  1921.  
  1922.     ifne    P61_pb
  1923. P61_pattbreak
  1924.     moveq    #64,d0
  1925.     move    d0,P61_rowpos-P61_cn(a3)
  1926.     clr    P61_CRow-P61_cn(a3)
  1927.     move.l    P61_spos(pc),a1
  1928.     move.l    P61_patternbase(pc),a0
  1929.     addq    #1,P61_Pos-P61_cn(a3)
  1930.     move.b    (a1)+,d0
  1931.     bpl.b    P61_dk2
  1932.     move.l    P61_possibase(pc),a1
  1933.     move.b    (a1)+,d0
  1934.     clr    P61_Pos-P61_cn(a3)
  1935. P61_dk2
  1936.     move.l    a1,P61_spos-P61_cn(a3)
  1937.     move.l    P61_positionbase(pc),a1
  1938.     move    d0,P61_Patt-P61_cn(a3)
  1939.     lsl    #3,d0
  1940.     add.l    d0,a1
  1941.     movem    (a1),d0-d3
  1942.     lea    (a0,d0.l),a1
  1943.     move    d1,d0
  1944.     move.l    a1,P61_ChaPos+P61_temp0-P61_cn(a3)
  1945.     lea    (a0,d0.l),a1
  1946.     move.l    a1,P61_ChaPos+P61_temp1-P61_cn(a3)
  1947.     move    d2,d0
  1948.     lea    (a0,d0.l),a1
  1949.     move.l    a1,P61_ChaPos+P61_temp2-P61_cn(a3)
  1950.     move    d3,d0
  1951.     add.l    d0,a0
  1952.     move.l    a0,P61_ChaPos+P61_temp3-P61_cn(a3)
  1953.     bra    P61_fxdone
  1954.     endc
  1955.  
  1956.     ifne    P61_vib
  1957. P61_vibrato
  1958.     move.b    P61_Info(a5),d0
  1959.     beq    P61_fxdone
  1960.     move.b    d0,d1
  1961.     move.b    P61_VibCmd(a5),d2
  1962.     and.b    #$f,d0
  1963.     beq.b    P61_vibskip
  1964.     and.b    #$f0,d2
  1965.     or.b    d0,d2
  1966. P61_vibskip
  1967.     and.b    #$f0,d1
  1968.     beq.b    P61_vibskip2
  1969.     and.b    #$f,d2
  1970.     or.b    d1,d2
  1971. P61_vibskip2
  1972.     move.b    d2,P61_VibCmd(a5)
  1973.     bra    P61_fxdone
  1974.     endc
  1975.  
  1976.     ifne    P61_tre
  1977. P61_settremo
  1978.     move.b    P61_Info(a5),d0
  1979.     beq    P61_fxdone
  1980.     move.b    d0,d1
  1981.     move.b    P61_TreCmd(a5),d2
  1982.     moveq    #$f,d3
  1983.     and.b    d3,d0
  1984.     beq.b    P61_treskip
  1985.     and.b    #$f0,d2
  1986.     or.b    d0,d2
  1987. P61_treskip
  1988.     and.b    #$f0,d1
  1989.     beq.b    P61_treskip2
  1990.     and.b    d3,d2
  1991.     or.b    d1,d2
  1992. P61_treskip2
  1993.     move.b    d2,P61_TreCmd(a5)
  1994.     bra    P61_fxdone
  1995.     endc
  1996.  
  1997.     ifne    P61_ec
  1998. P61_ecommands
  1999.     move.b    P61_Info(a5),d0
  2000.     and.b    #$f0,d0
  2001.     lsr    #3,d0
  2002.     move    P61_etab(pc,d0),d0
  2003.     jmp    P61_etab(pc,d0)
  2004.  
  2005. P61_etab
  2006.     ifne    P61_fi
  2007.     dc    P61_filter-P61_etab
  2008.     else
  2009.     dc    P61_fxdone-P61_etab
  2010.     endc
  2011.  
  2012.     ifne    P61_fsu
  2013.     dc    P61_fineup-P61_etab
  2014.     else
  2015.     dc    P61_fxdone-P61_etab
  2016.     endc
  2017.  
  2018.     ifne    P61_fsd
  2019.     dc    P61_finedwn-P61_etab
  2020.     else
  2021.     dc    P61_fxdone-P61_etab
  2022.     endc
  2023.  
  2024.     dc    P61_fxdone-P61_etab
  2025.     dc    P61_fxdone-P61_etab
  2026.  
  2027.     ifne    P61_sft
  2028.     dc    P61_setfinetune-P61_etab
  2029.     else
  2030.     dc    P61_fxdone-P61_etab
  2031.     endc
  2032.  
  2033.     ifne    P61_pl
  2034.     dc    P61_patternloop-P61_etab
  2035.     else
  2036.     dc    P61_fxdone-P61_etab
  2037.     endc
  2038.  
  2039.     dc    P61_fxdone-P61_etab
  2040.  
  2041.     ifne    P61_timing
  2042.     dc    P61_sete8-P61_etab
  2043.     else
  2044.     dc    P61_fxdone-P61_etab
  2045.     endc
  2046.  
  2047.     ifne    P61_rt
  2048.     dc    P61_setretrig-P61_etab
  2049.     else
  2050.     dc    P61_fxdone-P61_etab
  2051.     endc
  2052.  
  2053.     ifne    P61_fvu
  2054.     dc    P61_finevup-P61_etab
  2055.     else
  2056.     dc    P61_fxdone-P61_etab
  2057.     endc
  2058.  
  2059.     ifne    P61_fvd
  2060.     dc    P61_finevdwn-P61_etab
  2061.     else
  2062.     dc    P61_fxdone-P61_etab
  2063.     endc
  2064.  
  2065.     dc    P61_fxdone-P61_etab
  2066.  
  2067.     ifne    P61_nd
  2068.     dc    P61_ndelay-P61_etab
  2069.     else
  2070.     dc    P61_fxdone-P61_etab
  2071.     endc
  2072.  
  2073.     ifne    P61_pde
  2074.     dc    P61_pattdelay-P61_etab
  2075.     else
  2076.     dc    P61_fxdone-P61_etab
  2077.     endc
  2078.  
  2079.     ifne    P61_il
  2080.     dc    P61_funk-P61_etab
  2081.     else
  2082.     dc    P61_fxdone-P61_etab
  2083.     endc
  2084.     endc
  2085.  
  2086.     ifne    P61_fi
  2087. P61_filter
  2088.     move.b    P61_Info(a5),d0
  2089.     and.b    #$fd,$bfe001
  2090.     or.b    d0,$bfe001
  2091.     bra    P61_fxdone
  2092.     endc
  2093.  
  2094.     ifne    P61_fsu
  2095. P61_fineup
  2096.     P61_getnote
  2097.  
  2098.     moveq    #$f,d0
  2099.     and.b    P61_Info(a5),d0
  2100.     sub    d0,P61_Period(a5)
  2101.     moveq    #113,d0
  2102.     cmp    P61_Period(a5),d0
  2103.     ble.b    .jup
  2104.     move    d0,P61_Period(a5)
  2105. .jup
  2106.     moveq    #$7e,d0
  2107.     and.b    (a5),d0
  2108.     bne    P61_zample
  2109.     bra    P61_nocha
  2110.     endc
  2111.  
  2112.     ifne    P61_fsd
  2113. P61_finedwn
  2114.     P61_getnote
  2115.  
  2116.     moveq    #$f,d0
  2117.     and.b    P61_Info(a5),d0
  2118.     add    d0,P61_Period(a5)
  2119.     cmp    #856,P61_Period(a5)
  2120.     ble.b    .jup
  2121.     move    #856,P61_Period(a5)
  2122. .jup    moveq    #$7e,d0
  2123.     and.b    (a5),d0
  2124.     bne    P61_zample
  2125.     bra    P61_nocha
  2126.     endc
  2127.  
  2128.     ifne    P61_sft
  2129. P61_setfinetune
  2130.     moveq    #$f,d0
  2131.     and.b    P61_Info(a5),d0
  2132.     ifeq    opt020
  2133.     add    d0,d0
  2134.     move    P61_mulutab(pc,d0),P61_Fine(a5)
  2135.     else
  2136.     move    P61_mulutab(pc,d0*2),P61_Fine(a5)
  2137.     endc
  2138.     bra    P61_fxdone
  2139.  
  2140. P61_mulutab
  2141.     dc    0,74,148,222,296,370,444,518,592,666,740,814,888,962,1036,1110
  2142.     endc
  2143.  
  2144.     ifne    P61_pl
  2145. P61_patternloop
  2146.     moveq    #$f,d0
  2147.     and.b    P61_Info(a5),d0
  2148.     beq.b    P61_setloop
  2149.  
  2150.     tst.b    P61_plflag-P61_cn(a3)
  2151.     bne.b    P61_noset
  2152.  
  2153.     move    d0,P61_plcount-P61_cn(a3)
  2154.     st.b    P61_plflag-P61_cn(a3)
  2155. P61_noset
  2156.     tst    P61_plcount-P61_cn(a3)
  2157.     bne.b    P61_looppaa
  2158.     clr.b    P61_plflag-P61_cn(a3)
  2159.     bra    P61_fxdone
  2160.     
  2161. P61_looppaa
  2162.     st.b    P61_plflag+1-P61_cn(a3)
  2163.     subq    #1,P61_plcount-P61_cn(a3)
  2164.     bra    P61_fxdone
  2165.  
  2166. P61_setloop
  2167.     tst.b    P61_plflag-P61_cn(a3)
  2168.     bne    P61_fxdone
  2169.     move    P61_rowpos(pc),P61_plrowpos-P61_cn(a3)
  2170.     lea    P61_temp0+P61_TData(pc),a1
  2171.     lea    P61_looppos(pc),a0
  2172.     moveq    #channels-1,d0
  2173. .talt
  2174.     move.l    (a1)+,(a0)+
  2175.     move.l    (a1)+,(a0)+
  2176.     move.l    (a1),(a0)+
  2177.     subq.l    #8,a1
  2178.     add.l    d6,a1
  2179.     dbf    d0,.talt
  2180.     bra    P61_fxdone
  2181.     endc
  2182.  
  2183.     ifne    P61_fvu
  2184. P61_finevup
  2185.     moveq    #$f,d0
  2186.     and.b    P61_Info(a5),d0
  2187.     add    d0,P61_Volume(a5)
  2188.     moveq    #64,d0
  2189.     cmp    P61_Volume(a5),d0
  2190.     bge    P61_fxdone
  2191.     move    d0,P61_Volume(a5)
  2192.     bra    P61_fxdone
  2193.     endc
  2194.  
  2195.     ifne    P61_fvd
  2196. P61_finevdwn
  2197.     moveq    #$f,d0
  2198.     and.b    P61_Info(a5),d0
  2199.     sub    d0,P61_Volume(a5)
  2200.     bpl    P61_fxdone
  2201.     clr    P61_Volume(a5)
  2202.     bra    P61_fxdone
  2203.     endc
  2204.  
  2205.     ifne    P61_timing
  2206. P61_sete8
  2207.     moveq    #$f,d0
  2208.     and.b    P61_Info(a5),d0
  2209.     move    d0,P61_E8-P61_cn(a3)
  2210.     bra    P61_fxdone
  2211.     endc
  2212.  
  2213.     ifne    P61_rt
  2214. P61_setretrig
  2215.     moveq    #$f,d0
  2216.     and.b    P61_Info(a5),d0
  2217.     move    d0,P61_RetrigCount(a5)
  2218.     bra    P61_fxdone
  2219.     endc
  2220.  
  2221.     ifne    P61_nd
  2222. P61_ndelay
  2223.     moveq    #$7e,d0
  2224.     and.b    (a5),d0
  2225.     beq    P61_skip
  2226.     ifne    P61_vib
  2227.     clr.b    P61_VibPos(a5)
  2228.     endc
  2229.     ifne    P61_tre
  2230.     clr.b    P61_TrePos(a5)
  2231.     endc
  2232.     ifne    P61_ft
  2233.     add    P61_Fine(a5),d0
  2234.     endc
  2235.     move    d0,P61_Note(a5)
  2236.     move    (a2,d0),P61_Period(a5)
  2237.     ifeq    fade
  2238.     move    P61_Volume(a5),8(a4)
  2239.     else
  2240.     move    P61_Volume(a5),P61_Shadow(a5)
  2241.     endc
  2242.     bra    P61_skip
  2243.     endc
  2244.  
  2245.     ifne    P61_pde
  2246. P61_pattdelay
  2247.     moveq    #$f,d0
  2248.     and.b    P61_Info(a5),d0
  2249.     move    d0,P61_pdelay-P61_cn(a3)
  2250.     st    P61_pdflag-P61_cn(a3)
  2251.     bra    P61_fxdone
  2252.     endc
  2253.  
  2254.     ifne    P61_sd
  2255. P61_cspeed
  2256.     moveq    #0,d0
  2257.     move.b    P61_Info(a5),d0
  2258.  
  2259.     ifne    CIA
  2260.     tst    P61_Tempo-P61_cn(a3)
  2261.     beq.b    P61_VBlank
  2262.     cmp.b    #32,d0
  2263.     bhs.b    P61_STempo
  2264.     endc
  2265.  
  2266. P61_VBlank
  2267.     cmp.b    #1,d0
  2268.     beq.b    P61_jkd
  2269.  
  2270.     move.b    d0,P61_speed+1-P61_cn(a3)
  2271.     subq.b    #1,d0
  2272.     move.b    d0,P61_speed2+1-P61_cn(a3)
  2273.     clr    P61_speedis1-P61_cn(a3)
  2274.     bra    P61_fxdone
  2275.  
  2276. P61_jkd
  2277.     move.b    d0,P61_speed+1-P61_cn(a3)
  2278.     move.b    d0,P61_speed2+1-P61_cn(a3)
  2279.     st    P61_speedis1-P61_cn(a3)
  2280.     bra    P61_fxdone
  2281.  
  2282.  
  2283.     ifne    CIA
  2284. P61_STempo
  2285.     move.l    P61_timer(pc),d1
  2286.     divu    d0,d1
  2287.     move    d1,P61_thi2-P61_cn(a3)
  2288.     sub    #$1f0*2,d1
  2289.     move    d1,P61_thi-P61_cn(a3)
  2290.  
  2291.     ifeq    system
  2292.     move    P61_thi2-P61_cn(a3),d1
  2293.     move.b    d1,$bfd400
  2294.     lsr    #8,d1
  2295.     move.b    d1,$bfd500
  2296.     endc
  2297.  
  2298.     bra    P61_fxdone
  2299.     endc
  2300.     endc
  2301.  
  2302.  
  2303.  
  2304.     ifne    P61_vbvs
  2305. P61_vibochvslide
  2306.     move.b    P61_Info(a5),d0
  2307.     sub.b    d0,P61_Volume+1(a5)
  2308.     bpl.b    P61_test62
  2309.     clr    P61_Volume(a5)
  2310.     ifeq    fade
  2311.     clr    8(a4)
  2312.     else
  2313.     clr    P61_Shadow(a5)
  2314.     endc
  2315.     bra.b    P61_vib2
  2316. P61_test62
  2317.     moveq    #64,d0
  2318.     cmp    P61_Volume(a5),d0
  2319.     bge.b    .ncs2
  2320.     move    d0,P61_Volume(a5)
  2321. .ncs2
  2322.     ifeq    fade
  2323.     move    P61_Volume(a5),8(a4)
  2324.     else
  2325.     move    P61_Volume(a5),P61_Shadow(a5)
  2326.     endc
  2327.     endc
  2328.  
  2329.     ifne    P61_vib
  2330. P61_vib2
  2331.     move    #$f00,d0
  2332.     move    P61_VibCmd(a5),d1
  2333.     and    d1,d0
  2334.     lsr    #3,d0
  2335.  
  2336.     lsr    #2,d1
  2337.     and    #$1f,d1
  2338.     add    d1,d0
  2339.  
  2340.     move    P61_Period(a5),d1
  2341.     moveq    #0,d2
  2342.     move.b    P61_vibtab(pc,d0),d2
  2343.  
  2344.     tst.b    P61_VibPos(a5)
  2345.     bmi.b    .vibneg
  2346.     add    d2,d1
  2347.     bra.b    P61_vib4
  2348.  
  2349. .vibneg    sub    d2,d1
  2350.  
  2351. P61_vib4
  2352.     move    d1,6(a4)
  2353.     move.b    P61_VibCmd(a5),d0
  2354.     lsr.b    #2,d0
  2355.     and    #$3c,d0
  2356.     add.b    d0,P61_VibPos(a5)
  2357.     bra    P61_contfxdone
  2358.     endc
  2359.  
  2360.     ifne    P61_tre
  2361. P61_tremo
  2362.     move    #$f00,d0
  2363.     move    P61_TreCmd(a5),d1
  2364.     and    d1,d0
  2365.     lsr    #3,d0
  2366.     
  2367.     lsr    #2,d1
  2368.     and    #$1f,d1
  2369.     add    d1,d0
  2370.  
  2371.     move    P61_Volume(a5),d1
  2372.     moveq    #0,d2
  2373.     move.b    P61_vibtab(pc,d0),d2
  2374.  
  2375.     tst.b    P61_TrePos(a5)
  2376.     bmi.b    .treneg
  2377.     add    d2,d1
  2378.     cmp    #64,d1
  2379.     ble.b    P61_tre4
  2380.     moveq    #64,d1
  2381.     bra.b    P61_tre4
  2382.  
  2383. .treneg
  2384.     sub    d2,d1
  2385.     bpl.b    P61_tre4
  2386.     moveq    #0,d1
  2387. P61_tre4
  2388.     ifeq    fade
  2389.     move    d1,8(a4)
  2390.     else
  2391.     move    d1,P61_Shadow(a5)
  2392.     endc
  2393.  
  2394.     move.b    P61_TreCmd(a5),d0
  2395.     lsr.b    #2,d0
  2396.     and    #$3c,d0
  2397.     add.b    d0,P61_TrePos(a5)
  2398.     bra    P61_contfxdone
  2399.     endc
  2400.  
  2401.     ifne    P61_vib!P61_tre
  2402. P61_vibtab
  2403.     incbin    vibtab
  2404.     endc
  2405.  
  2406.     ifne    P61_il
  2407. P61_funk
  2408.     moveq    #$f,d0
  2409.     and.b    P61_Info(a5),d0
  2410.     move.b    d0,P61_Funkspd(a5)
  2411.     bra    P61_fxdone
  2412.  
  2413. P61_funk2
  2414.     moveq    #0,d0
  2415.     move.b    P61_Funkspd(a5),d0
  2416.     beq.b    P61_funkend
  2417.     move.b    P61_FunkTable(pc,d0),d0
  2418.     add.b    d0,P61_Funkoff(a5)
  2419.     bpl.b    P61_funkend
  2420.     clr.b    P61_Funkoff(a5)
  2421.  
  2422.     move.l    P61_Sample(a5),a1
  2423.     move.l    P61_RepeatOffset(a1),d1
  2424.     move    P61_RepeatLength(a1),d0
  2425.     add.l    d0,d0
  2426.     add.l    d1,d0
  2427.     move.l    P61_Wave(a5),a0
  2428.     addq.l    #1,a0
  2429.     cmp.l    d0,a0
  2430.     blo.b    P61_funkok
  2431.     move.l    d1,a0
  2432. P61_funkok
  2433.     move.l    a0,P61_Wave(a5)
  2434.     not.b    (a0)
  2435. P61_funkend
  2436.     rts
  2437.  
  2438. P61_FunkTable
  2439.     dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128
  2440.     endc
  2441.  
  2442. P61_jtab
  2443.     dc    P61_fxdone-*
  2444.     dc    P61_fxdone-*
  2445.     dc    P61_fxdone-*
  2446.  
  2447.     ifne    P61_tp
  2448.     dc    P61_settoneport-*
  2449.     else
  2450.     dc    P61_fxdone-*
  2451.     endc
  2452.  
  2453.     ifne    P61_vib
  2454.     dc    P61_vibrato-*
  2455.     else
  2456.     dc    P61_fxdone-*
  2457.     endc
  2458.  
  2459.     ifne    P61_tpvs
  2460.     dc    P61_toponochange-*
  2461.     else
  2462.     dc    P61_fxdone-*
  2463.     endc
  2464.  
  2465.     dc    P61_fxdone-*
  2466.  
  2467.     ifne    P61_tre
  2468.     dc    P61_settremo-*
  2469.     else
  2470.     dc    P61_fxdone-*
  2471.     endc
  2472.  
  2473.     dc    P61_fxdone-*
  2474.  
  2475.     ifne    P61_sof
  2476.     dc    P61_sampleoffse-*
  2477.     else
  2478.     dc    P61_fxdone-*
  2479.     endc
  2480.     dc    P61_fxdone-*
  2481.  
  2482.     ifne    P61_pj
  2483.     dc    P61_posjmp-*
  2484.     else
  2485.     dc    P61_fxdone-*
  2486.     endc
  2487.  
  2488.     ifne    P61_vl
  2489.     dc    P61_volum-*
  2490.     else
  2491.     dc    P61_fxdone-*
  2492.     endc
  2493.  
  2494.     ifne    P61_pb
  2495.     dc    P61_pattbreak-*
  2496.     else
  2497.     dc    P61_fxdone-*
  2498.     endc
  2499.  
  2500.     ifne    P61_ec
  2501.     dc    P61_ecommands-*
  2502.     else
  2503.     dc    P61_fxdone-*
  2504.     endc
  2505.     
  2506.     ifne    P61_sd
  2507.     dc    P61_cspeed-*
  2508.     else
  2509.     dc    P61_fxdone-*
  2510.     endc
  2511.  
  2512.  
  2513. P61_dmason
  2514.     ifeq    system
  2515.     tst.b    $bfdd00
  2516.     move    #$2000,$dff09c
  2517.     move    #$2000,$dff09c    ;!!!
  2518.     move.b    #$19,$bfdf00
  2519.     move.l    a0,-(sp)
  2520.     move.l    P61_vektori(pc),a0
  2521.     move.l    P61_intaddr(pc),(a0)
  2522.     move.l    (sp)+,a0
  2523.     move    P61_dma(pc),$dff096
  2524.     nop
  2525.     rte
  2526.  
  2527.     else
  2528.  
  2529.     move    P61_dma(pc),$96(a6)
  2530.     lea    P61_server(pc),a3
  2531.     addq    #1,(a3)
  2532.     move.l    P61_craddr(pc),a0
  2533.     move.b    #$19,(a0)
  2534.     bra    P61_ohi
  2535.     endc
  2536.  
  2537.  
  2538. P61_setrepeat
  2539.     ifeq    system
  2540.     tst.b    $bfdd00
  2541.     movem.l    a0/a1,-(sp)
  2542.     lea    $dff0a0,a1
  2543.     move    #$2000,-4(a1)
  2544.     move    #$2000,-4(a1)    ;!!!
  2545.     else
  2546.     lea    $a0(a6),a1
  2547.     endc
  2548.  
  2549.     move.l    P61_Sample+P61_temp0(pc),a0
  2550.     addq.l    #6,a0
  2551.     move.l    (a0)+,(a1)+
  2552.     move    (a0),(a1)
  2553.  
  2554.     ifgt    channels-1
  2555.     move.l    P61_Sample+P61_temp1(pc),a0
  2556.     addq.l    #6,a0
  2557.     move.l    (a0)+,12(a1)
  2558.     move    (a0),16(a1)
  2559.     endc
  2560.     
  2561.     ifgt    channels-2
  2562.     move.l    P61_Sample+P61_temp2(pc),a0
  2563.     addq.l    #6,a0
  2564.     move.l    (a0)+,28(a1)
  2565.     move    (a0),32(a1)
  2566.     endc
  2567.  
  2568.     ifgt    channels-3
  2569.     move.l    P61_Sample+P61_temp3(pc),a0
  2570.     addq.l    #6,a0
  2571.     move.l    (a0)+,44(a1)
  2572.     move    (a0),48(a1)
  2573.     endc
  2574.  
  2575.     ifne    system
  2576.     ifne    CIA
  2577.     lea    P61_server(pc),a3
  2578.     clr    (a3)
  2579.     move.l    P61_craddr+4(pc),a0
  2580.     move.b    P61_tlo(pc),(a0)
  2581.     move.b    P61_thi(pc),$100(a0)
  2582.     endc
  2583.     bra    P61_ohi
  2584.     endc
  2585.  
  2586.     ifeq    system
  2587.     ifne    CIA
  2588.     move.l    P61_vektori(pc),a0
  2589.     move.l    P61_tintti(pc),(a0)
  2590.     endc
  2591.     movem.l    (sp)+,a0/a1
  2592.     nop
  2593.     rte
  2594.     endc
  2595.  
  2596. P61_temp0
  2597.     dcb.b    Channel_Block_SIZE-2,0
  2598.     dc    1
  2599.  
  2600. P61_temp1
  2601.     dcb.b    Channel_Block_SIZE-2,0
  2602.     dc    2
  2603.  
  2604. P61_temp2
  2605.     dcb.b    Channel_Block_SIZE-2,0
  2606.     dc    4
  2607.  
  2608. P61_temp3
  2609.     dcb.b    Channel_Block_SIZE-2,0
  2610.     dc    8
  2611.  
  2612. P61_cn
  2613.     dc    0
  2614. P61_dma        
  2615.     dc    $8200
  2616. P61_rowpos
  2617.     dc    0
  2618. P61_slen
  2619.     dc    0
  2620. P61_speed
  2621.     dc    0
  2622. P61_speed2
  2623.     dc    0
  2624. P61_speedis1
  2625.     dc    0
  2626. P61_spos
  2627.     dc.l    0
  2628.  
  2629.     ifeq    system
  2630. P61_vektori
  2631.     dc.l    0
  2632. P61_oldlev6
  2633.     dc.l    0
  2634.     endc
  2635.  
  2636. P61_ofilter
  2637.     dc    0
  2638. P61_timers
  2639.     dc.l    0
  2640.  
  2641.     ifne    CIA
  2642. P61_tintti
  2643.     dc.l    0
  2644. P61_thi
  2645.     dc.b    0
  2646. P61_tlo    
  2647.     dc.b    0
  2648. P61_thi2
  2649.     dc.b    0
  2650. P61_tlo2
  2651.     dc.b    0
  2652. P61_timer
  2653.     dc.l    0
  2654.     endc
  2655.  
  2656.     ifne    P61_pl
  2657. P61_plcount
  2658.     dc    0
  2659. P61_plflag
  2660.     dc    0
  2661. P61_plreset
  2662.     dc    0
  2663. P61_plrowpos
  2664.     dc    0
  2665. P61_looppos
  2666.     dcb.b    12*channels,0
  2667.     endc
  2668.  
  2669.     ifne    P61_pde
  2670. P61_pdelay
  2671.     dc    0
  2672. P61_pdflag
  2673.     dc    0
  2674.     endc
  2675.  
  2676. P61_samples
  2677.     dcb.b    16*31,0
  2678. P61_emptysample
  2679.     dcb.b    16,0
  2680. P61_positionbase
  2681.     dc.l    0
  2682. P61_possibase
  2683.     dc.l    0
  2684. P61_patternbase
  2685.     dc.l    0
  2686. P61_intaddr
  2687.     dc.l    0
  2688.  
  2689.     ifne    system
  2690. P61_server
  2691.     dc    0
  2692. P61_miscbase
  2693.     dc.l    0
  2694. P61_audioopen
  2695.     dc.b    0
  2696. P61_sigbit
  2697.     dc.b    -1
  2698. P61_ciares
  2699.     dc.l    0
  2700. P61_craddr
  2701.     dc.l    0,0,0
  2702. P61_dat
  2703.         dc    $f00
  2704. P61_timerinterrupt
  2705.     dc    0,0,0,0,127
  2706. P61_timerdata
  2707.     dc.l    0,0,0
  2708. P61_timeron
  2709.     dc    0
  2710. P61_allocport
  2711.     dc.l    0,0
  2712.     dc.b    4,0
  2713.     dc.l    0
  2714.     dc.b    0,0
  2715.     dc.l    0
  2716. P61_reqlist
  2717.     dc.l    0,0,0
  2718.     dc.b    5,0
  2719. P61_allocreq
  2720.     dc.l    0,0
  2721.     dc    127
  2722.     dc.l    0
  2723. P61_portti
  2724.     dc.l    0
  2725.     dc    68
  2726.     dc.l    0,0,0
  2727.     dc    0
  2728. P61_reqdata
  2729.     dc.l    0
  2730.     dc.l    1,0,0,0,0,0,0
  2731.     dc    0
  2732. P61_audiodev
  2733.     dc.b    'audio.device',0
  2734.  
  2735. P61_cianame
  2736.     dc.b    'ciab.resource',0
  2737. P61_timeropen
  2738.     dc.b    0
  2739. P61_timerint
  2740.     dc.b    'P61_TimerInterrupt',0,0
  2741.     endc
  2742. P61_etu
  2743.  
  2744. ******** END OF BINARY FILE **************
  2745.  
  2746.     ifne    example
  2747.     section    chip,data_c
  2748. P61_data
  2749.     incbin    "P61.testmod"
  2750. ;P61_smp    incbin    "ram:SMP.fields of green"
  2751.  
  2752. ;    section    smp,bss_c
  2753. ;samples
  2754.         ;ds.b   $10000          ;uncomment if you have packed samples
  2755.                                 ;and insert sample buffer length
  2756.                                 ;also go to the line where samples
  2757.                                 ;is loaded into a2 and uncomment it
  2758.     endc
  2759.     
  2760.     ifne    asmone
  2761.     ifd     makebin
  2762.     auto    wb ram:610.4.bin_new\P61_motuuli\P61_etu\
  2763.     endc
  2764.     endc
  2765.     END
  2766.  
  2767.